package top.lt.lt_ssm.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import top.lt.lt_ssm.bean.users;
import top.lt.lt_ssm.service.usersService;
import top.lt.lt_ssm.util.SimpleResult;

@Controller
@RequestMapping("/user")
public class UserController {
	@Resource
	private usersService usersService;
	
	@RequestMapping("/Getin1/{in1}")
	public @ResponseBody SimpleResult Getin1(@PathVariable("in1") String in1) {
		List<users> getusn = usersService.getusn(in1);
		return new SimpleResult(getusn);
	}
	@RequestMapping("/Getin2/{in2}")
	public @ResponseBody SimpleResult Getin2(@PathVariable("in2") String in2) {
		List<users> getdh = usersService.getdh(in2);
		return new SimpleResult(getdh);
	}
	@RequestMapping("/Getin3/{in3}")
	public @ResponseBody SimpleResult Getin3(@PathVariable("in3") String in3) {
		List<users> getsex = usersService.getsex(in3);
		return new SimpleResult(getsex);
	}
	
	@RequestMapping("/GetAll")
	public @ResponseBody SimpleResult GetAll() {
		List<users> usersGetAll = usersService.usersGetAll();
		usersGetAll.forEach(s->{
			System.out.println(s);
		});
		return new SimpleResult(usersGetAll);
	}
	
	
	
	
	//�û��б�
	@RequestMapping("/list")
	public String toUser() {
		return "user/user_list";
	}
	
	//����Աע��ƽ̨�û�
	@RequestMapping("/register")
	public String register() {
		return "user/register";
	}
	
	//��������(����ƽ̨�û������Ѽ�¼,���ѽ�������ɲ�ͬ�ȼ�,��Ҫ��ʱ��������Ͳ�ͬ�Ĺ���)
	@RequestMapping("/consumeAssess")
	public String consumeAssess() {
		return "user/consumeAssess";
	}
	
	
	//���ѽ�����а�(�����û��¹��ĵ��У����ս�������������)
	@RequestMapping("/consumeRankingList")
	public String consumeRankingList() {
		return "user/consumeRankingList";
	}
	
	//���Ѽ�¼���а�(�����û����У����������ܽ�������������)
	@RequestMapping("/consumeRecordList")
	public String consumeRecordList() {
		return "user/consumeRecordList";
	}
}
